# this is part of arcflowc.mod, used to append arcflow 
# Yu Liu

set TYPE; #:= {1,3,12,48,192};
param unit {TYPE};
var stype {LINKS, TYPE} binary default 0;
var ntype {LINKS, TYPE} integer default 0 >= 0;

minimize s_cost: 
 sum {(i1,i2) in LINKS, k in TYPE} ntype[i1,i2, k] * unit[k];

s.t. one_type {(i1,i2) in LINKS}: 
 sum {k in TYPE} stype[i1,i2,k] <= 1;
s.t. num_one {(i1,i2) in LINKS, k in TYPE diff {192}}: 
 ntype[i1,i2,k] <= 1 ;
s.t. num_more {(i1,i2) in LINKS}: 
 ntype[i1,i2,192] <= stype[i1,i2,192] *20;
s.t. enough {(i1,i2) in LINKS}:
 sum{k in TYPE} ntype[i1,i2,k] * k >= s[i1,i2];

problem spare_cost:
 s_cost,  mass_ba2, cap_aggr2, 
  spare_prov, link_disjoint, 
  one_type, num_one, num_more, enough,
  B, C, s, stype, ntype;

problem cal_s_cost:
 s_cost,  
  one_type, num_one, num_more, enough,
  stype, ntype;

